<?php
declare (strict_types = 1);
namespace app\course\model\note;

use app\common\model\BaseModel;
use app\user\model\user\Account;

/**
 * 定义课程点评模型
 */
class Note extends BaseModel
{
    /**
     * 表名
     * @var string
     */
    protected $name = 'course_note';

    /**
     * 设置自动写入时间
     * @var boolean
     */
    protected $autoWriteTimestamp = true;
    protected $updateTime = false;
    protected $hidden = ['delete_time'];

    /**
     * 定义字段类型
     * @var array
     */
    protected $type = [
        'id'          => 'integer',
        'delete_time' => 'integer',
        'create_time' => 'integer',
    ];

    public function user()
    {
        return $this->belongsTo(Account::class,'user_id')->append(['avatar_url']);
    }

}
